package com.material.buy.service.impl;

import java.util.List;
import com.material.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.material.buy.mapper.VipPackageMapper;
import com.material.buy.domain.VipPackage;
import com.material.buy.service.IVipPackageService;

/**
 * vip充值套餐Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-07
 */
@Service
public class VipPackageServiceImpl implements IVipPackageService 
{
    @Autowired
    private VipPackageMapper vipPackageMapper;

    /**
     * 查询vip充值套餐
     * 
     * @param id vip充值套餐主键
     * @return vip充值套餐
     */
    @Override
    public VipPackage selectVipPackageById(Long id)
    {
        return vipPackageMapper.selectVipPackageById(id);
    }

    /**
     * 查询vip充值套餐列表
     * 
     * @param vipPackage vip充值套餐
     * @return vip充值套餐
     */
    @Override
    public List<VipPackage> selectVipPackageList(VipPackage vipPackage)
    {
        return vipPackageMapper.selectVipPackageList(vipPackage);
    }

    /**
     * 新增vip充值套餐
     * 
     * @param vipPackage vip充值套餐
     * @return 结果
     */
    @Override
    public int insertVipPackage(VipPackage vipPackage)
    {
        vipPackage.setCreateTime(DateUtils.getNowDate());
        return vipPackageMapper.insertVipPackage(vipPackage);
    }

    /**
     * 修改vip充值套餐
     * 
     * @param vipPackage vip充值套餐
     * @return 结果
     */
    @Override
    public int updateVipPackage(VipPackage vipPackage)
    {
        return vipPackageMapper.updateVipPackage(vipPackage);
    }

    /**
     * 批量删除vip充值套餐
     * 
     * @param ids 需要删除的vip充值套餐主键
     * @return 结果
     */
    @Override
    public int deleteVipPackageByIds(Long[] ids)
    {
        return vipPackageMapper.deleteVipPackageByIds(ids);
    }

    /**
     * 删除vip充值套餐信息
     * 
     * @param id vip充值套餐主键
     * @return 结果
     */
    @Override
    public int deleteVipPackageById(Long id)
    {
        return vipPackageMapper.deleteVipPackageById(id);
    }
}
